package com.will.txj.aj.security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.will.txj.common.security.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wen-yi
 * @since 2021-11-26
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("select r.role_code " +
            "from aj_sys_user u,sys_user_role ur,aj_sys_role r " +
            "where u.id = ur.u_id and ur.r_id = r.id and u.username = #{username} " +
            "and ur.dis = 1 and r.dis = 1")
    List<SysRole> getRoleListByUsername(@Param("username") String username);
}
